package com.ajk.server.service;
import java.util.List;

import com.ajk.server.model.DepartmentDict;
import com.ajk.server.model.query.DepartmentDictQuery;
import com.ajk.server.model.response.DepartmentDictRes;

/**
 * 科室  <br>
 * dict_department <br>
 * v1.0 2016-05-01
 */
 public interface DepartmentDictService {
	
	/**
 	*根据ID删除 科室
 	*/
 	public Integer deleteDepartmentDictById(Integer id);
 	
 	/**
 	*新增 科室
 	*/
 	public Integer batchInsertDepartmentDict(List<? extends DepartmentDict> departmentDicts);
 	
 	/**
 	*新增 科室
 	*/
 	public Integer insertDepartmentDict(DepartmentDict domain);
 
 	
 	/**
 	*更新 科室
 	*/
 	public Integer updateDepartmentDict(DepartmentDict domain);
 	
 	/**
 	*根据ID查询 科室
 	*/
 	public DepartmentDict findByIdWithCache(Integer id);
 	
 	public DepartmentDict findById(Integer id);


	/**
 	*通过query 查询 科室
 	*/
	public List<DepartmentDict> findDepartmentDictByQuery(DepartmentDictQuery query);	
	
	/**
 	*通过query count总条数
 	*/
 	public Integer countDepartmentDictByQuery(DepartmentDictQuery query);
 	
 	/**
 	* 通过ids查询
 	*/
 	public List<DepartmentDict> findDepartmentDictByIds(List<Integer> ids);
 	
 	/**
 	*根据name查询 科室
 	*/
	public DepartmentDict findByName(String name);
	
	/**
 	*获取所有字典 科室
 	*/
	public List<DepartmentDict> findAll();
	
	public  List<DepartmentDict> findAllWithCache();
	
	public DepartmentDict findDepartmentDictByIdWithCache(Integer id);
	
	public List<DepartmentDict> findChildrenByParentId(Integer parentId);
	
	public void syncSingletonRedis(Integer departmentId);
	
	public void syncInRedis(boolean force);	
	
	public List<DepartmentDictRes> findFirstDepartment(Integer hospitalId);
	
	public DepartmentDict findByChildId(Integer childId);
	
}	